package com.lab.domain;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class User {
	private String id;
	private String name;
	private String password;
	private Timestamp birth;
	private String sex;
	private String idCard;
	/**身份类型*/
	private int type;
	private String address;
	private String class1;
	private String phoneNumber;
	private String email;
	private String headImg;
	private int status;
	private String tag;
	private String otherInfo;
	/**非学生可以不填*/
	public String getClass1() {
		return class1;
	}
	/**非学生可以不填*/
	public void setClass1(String class1) {
		this.class1 = class1;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getEmail() {
		return email;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Timestamp getBirth() {
		return birth;
	}
	public String getBirth1() {
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
		return dateFormat.format(birth);
	}
	public void setBirth(Timestamp birth) {
		this.birth = birth;
	}
	public void setBirth(String birth) {
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		try {
			Date date= format.parse(birth);
			this.birth=new Timestamp(date.getTime());
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getIdCard() {
		return idCard;
	}
	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	/**身份类型 7校外人员 1学生 2老师 3专家 4主管 5实验室管理员 6超级管理员*/
	public int getType() {
		return type;
	}
	/**身份类型 7校外人员 1学生 2老师 3专家 4主管 5实验室管理员 6超级管理员*/
	public void setType(int type) {
		this.type = type;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getHeadImg() {
		return headImg;
	}
	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}
	/**存在状态以后可能会保留信息而不会删除
	 * @param status 默认为1在职 */
	public int getStatus() {
		return status;
	}
	/**存在状态以后可能会保留信息而不会删除
	 * @param status 默认为1在职 */
	public void setStatus(int status) {
		this.status = status;
	}
	public String getTag() {
		return tag;
	}
	public void setTag(String tag) {
		this.tag = tag;
	}
	public String getOtherInfo() {
		return otherInfo;
	}
	public void setOtherInfo(String otherInfo) {
		this.otherInfo = otherInfo;
	}
	@Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", password=" + password + ", birth=" + birth + ", sex=" + sex
				+ ", idCard=" + idCard + ", type=" + type + ", address=" + address + ", class1=" + class1
				+ ", phoneNumber=" + phoneNumber + ", email=" + email + ", headImg=" + headImg + ", status=" + status
				+ ", tag=" + tag + ", otherInfo=" + otherInfo + "]";
	}
	
}
